package com.jd.controller;


import com.jd.entity.Gorder;
import com.jd.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created by Administrator on 2017/9/20/020.
 */
@Controller
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("list")
    public String list(Model model, Integer uid){
        List<Gorder> list = orderService.findByUid(uid);
        model.addAttribute("list",list);
        return "order/list";
    }
    @RequestMapping("saveOrder")
    public String saveOrder(Gorder gorder){
        orderService.saveOrder(gorder);
        return "order/buy";
    }

}
